package com.changgou.controller;

import com.changgou.service.OrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author: hushengjin
 */
@RestController
@RequestMapping("/orderInfo")
@CrossOrigin
public class OrderInfoController {

    @Autowired
    private OrderInfoService orderInfoService;

    @PostMapping("/add")
    public String add(@RequestParam(value = "username") String username,
                      @RequestParam(value = "count") int count,
                      @RequestParam(value = "id") int id) {
        //添加订单
        orderInfoService.add(username, id, count);
        return "success";
    }

}
